package linc.cool.robot.leetcode;

import lombok.Data;
import lombok.ToString;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.List;
import java.util.Objects;

/**
 * @author yqlin
 * @date 2022/4/9 20:52
 * @description
 */
@Data
@Accessors(chain = true)
@ToString()
public class LeetCodeProblem implements Serializable {
    /**
     * 题号
     */
    private String frontendQuestionId;
    /**
     * 题目中文名称
     */
    private String titleCn;
    /**
     * 题目英文名称
     */
    private String title;
    /**
     * 难易程度
     */
    private String difficulty;

    /**
     * 对应的是指令的problem
     */
    private String titleSlug;
    /**
     * 属于什么类型的题目: [链表,数学...]
     */
    private List<String> nameTranslatedList;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        LeetCodeProblem problem = (LeetCodeProblem) o;
        return Objects.equals(frontendQuestionId, problem.frontendQuestionId) && Objects.equals(titleSlug, problem.titleSlug);
    }

    @Override
    public int hashCode() {
        return Objects.hash(frontendQuestionId, titleSlug);
    }
}
